package april.test_4_28;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        String s = scanner.next();
        System.out.print(s.substring(k-1));
        if((n - k) % 2 == 1) {
            System.out.println(s.substring(0,k - 1));
        } else {
            for (int i = 0; i < k - 1; i++) {
                System.out.print(s.charAt(k-i-2));
            }
        }
    }
}
